<template>
  <div>
    <h1>App</h1>
    <button @click="num++">ADD {{ num }}</button>

    <button @click="get">获取 hwRef</button>
    <hr />

    <HelloWorld ref="hwRef" :initialCount="num" a="1" b="2" @click="num++" @abcd="fn">
      <template #default="{ name }">
        <h1>我的天 {{ name }}</h1>
      </template>

      <template #top>
        <button>我的 Top</button>
      </template>
    </HelloWorld>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  components: {
    HelloWorld
  },

  data() {
    return {
      num: 10
    }
  },

  methods: {
    fn(aaa) {
      console.log('aaa', aaa)
      this.num++
    },

    get() {
      console.log(this.$refs.hwRef)
    }
  }
}
</script>
